var t = require;
var e = module;
var n = exports;
Object.defineProperty(n, "__esModule", { value: !0 });
var o = t("BootConst"),
    r = (function() {
        function t() {}
        return (
            (t.init = function() {
                var t = o.dd.ta_appIds["所有平台"];
                if (t) "4399小游戏" == window.platformType || true && (t = void 0);
                else if (window.platformType) t = o.dd.ta_appIds[window.platformType];
                else
                    for (var e in o.dd.ta_appIds)
                        if ((t = o.dd.ta_appIds[e])) break;
                t &&
                    (console.log("ta_appId=" + t),
                        (this.ta = new ThinkingAnalyticsAPI({
                            appId: t,
                            gogogo: "",
                            debugMode: "none",
                            enableLog: !1,
                            autoTrack: { appShow: !0, appHide: !0 }
                        })),
                        this.ta.init(),
                        console.log("deviceId=" + this.ta.getDeviceId()));
            }),
            (t.login = function(t) {
                this.ta && this.ta.login(t);
            }),
            (t.dd = function(t, e) {
                if (this.ta)
                    if (t.ta_aparts) {
                        var n = { userSets: [], tracks: [] };
                        for (var o in e) n.tracks.push(o);
                        for (var o in t.ta_aparts)
                            switch (o) {
                                case "userSets":
                                    for (var r = 0, a = t.ta_aparts[o]; r < a.length; r++) {
                                        var i = a[r];
                                        n[o].push(i);
                                    }
                            }
                        n.userSets.length && this.userSet(this.getKVs(e, n.userSets)),
                            n.tracks.length && this.track(t.ta_name, this.getKVs(e, n.tracks));
                    } else this.track(t.ta_name, e);
            }),
            (t.getKVs = function(t, e) {
                for (var n = {}, o = 0, r = e; o < r.length; o++) {
                    var a = r[o];
                    n[a] = t[a];
                }
                return n;
            }),
            (t.track = function(t, e) {
                this.ta.track(t, e);
            }),
            (t.userSet = function(t) {
                this.ta.userSet(t);
            }),
            t
        );
    })();
n.default = r;